#ifndef _SINGLETON_ALLOCTOR_H
#define _SINGLETON_ALLOCTOR_H

#include "sevenbox/faskeos/fakeos.h"
#include "sevenbox/base/dalloc.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    void *_ptr;
    void *_info;
}singleton_pointer_t;

int singleton_alloc_init(dalloc_heap_t *heap_struct_ptr, void *mem_ptr, uint32_t mem_size);
int singleton_ptr_malloc(dalloc_heap_t *heap_struct_ptr, singleton_pointer_t *ptr, uint32_t size, uint32_t id);
int singleton_ptr_free(dalloc_heap_t *heap_struct_ptr, singleton_pointer_t *ptr);

int singleton_ptr_set(singleton_pointer_t *ptr, uint32_t offset, void *data, uint32_t len);
int singleton_ptr_get(singleton_pointer_t *ptr, uint32_t offset, void *buff, uint32_t len);


#ifdef __cplusplus
}
#endif

#endif
